var n;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LoadingMgr = undefined;
var BundleConfig = require("AA_BundleConfig");
var ResLoader = require("AA_ResLoader");
var ResUtil = require("AA_ResUtil");
var SingletonManager = require("AA_SingletonManager");
var s = function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t._loading = null;
    t._hide = false;
    t._isLoadRes = false;
    return t;
  }
  __extends(t, e);
  t.prototype.show = function () {
    this._hide = true;
    if (this._loading) {
      this._doLoading();
    } else {
      this._getLoading();
    }
  };
  t.prototype.hide = function () {
    if (this._loading) {
      this._hide = true;
      this._loading.active = false;
    } else {
      this._hide = false;
    }
  };
  t.prototype._getLoading = function () {
    var e = this;
    if (!this._isLoadRes) {
      this._isLoadRes = true;
      ResLoader.default.loadRes(BundleConfig.BundleNames.Resouce, "res/common/UI_Loading", cc.Prefab).then(function (t) {
        e._loading = ResUtil.ResUtil.instantiate(t);
        cc.director.getScene().getChildByName("Canvas").getChildByName("UILoading").addChild(e._loading);
        e._doLoading();
      });
    }
  };
  t.prototype._doLoading = function () {
    this._loading.active = this._hide;
  };
  return t;
}(SingletonManager.SingletonMgr);
exports.LoadingMgr = s.getInstance();